//
//  SelfSizeTool.m
//  010-自适应高度
//
//  Created by 李昊林 on 16/7/27.
//  Copyright © 2016年 李昊林. All rights reserved.
//

#import "SelfSizeTool.h"
@implementation SelfSizeTool
+ (CGFloat)selfSizeWidthWithString:(NSString *)string
                             height:(CGFloat)height
                              font:(UIFont *)font {
    CGRect newRect = [string boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, height) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:font} context:nil];
    return newRect.size.width + 0.5;
}
@end
